<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>差旅展示</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type="text/javascript" src="<%=basePath%>manage/js/jquery.js"></script>
		<script language="javascript" type="text/javascript" src="<%=basePath%>datemaker/WdatePicker.js"></script>
		<script type="text/javascript" src="manage/js/addbg.js"></script>
		<link rel="stylesheet" type="text/css" href="manage/css/guanli.css"></link>

	</head>
	<body>
	
	<form action="findTravel" name="findTravel" method="POST">
	<h2 class="tableTitle">差旅展示</h2>
	<table class="cssrain" >
		<thead>
			<tr> 
				<th colspan="10">
					<strong>员工编号：</strong><input type="text" name="staffId" value="${staffId}"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
					<strong>按年月查找：</strong>年&nbsp;&nbsp;份
							<select name="year" style="margin: 0 45px 0 0;">
								<option value="0">==请选择==</option>
								<%
									Calendar calendar = Calendar.getInstance();
										int nowYear = calendar.get(Calendar.YEAR);
										for (int i = 2000; i <= nowYear; i++) {
								%>
								<option value="<%=i%>"
									<%Object yearObj = request.getAttribute("year");
					String year = null;
					if (yearObj != null)
						year = yearObj.toString();
					if (year != null && i == new Integer(year)) {%>
									selected="selected" <%}%>>
									<%=i%>
								</option>
								<%
									}
								%>
							</select>&nbsp;&nbsp;&nbsp;&nbsp;
				月&nbsp;&nbsp;份:
							<s:select cssStyle="margin:0 45 0 0" name="month"
								list="#{0:'==请选择==',1:'1月',2:'2月',3:'3月',4:'4月',5:'5月',6:'6月',7:'7月',8:'8月',9:'9月',10:'10月',11:'11月',12:'12月'}"></s:select>
			
					<input type="submit" value="查询" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="reset" value="重置" />
				
				</th>
			</tr>
			<tr>
				<th>员工编号</th>
				<th>差旅类型</th>
				<th>差旅开始时间</th>
				<th>差旅结束时间</th>
				<th>补&nbsp;&nbsp;&nbsp;&nbsp;贴</th>
				<th>是否上交发票</th>
				<th>应交金额</th>
				<th>已交金额</th>
				<th>未交金额</th>
				<th>补贴状态</th>
			</tr>
		</thead>
		<tbody>
			<s:if test="travelList!=null && !travelList.isEmpty()">
				<s:iterator value="travelList">
			<tr<s:if test="notpaid > 0">
						style="background-color:yellow;color:red;"
					</s:if>>
				<td><s:property value="staff.staffId"/></td>
				<td><s:property value="typeByTypeId.name"/></td>
				<td><s:date name="start" format="yyyy-MM-dd"/></td>
				<td><s:date name="end" format="yyyy-MM-dd"/></td>
				<td><s:property value="subsidy"/></td>
				<td>
					<s:if test="typeByHandInId.name=='true'">是</s:if>
					<s:else>否</s:else>
				</td>
				<td><s:property value="payable"/></td>
				<td><s:property value="paid"/></td>
				<td><s:property value="notpaid"/></td>
				<td>
					<s:if test="typeByStatus.name=='true'">已补贴</s:if>
					<s:else>未补贴</s:else>
				</td>
			</tr>
			</s:iterator>
			</s:if>
			<s:else>
				<tr>
					<td colspan="10">没有记录</td>
				</tr>
			</s:else>
			<tr>
				<td colspan="10">
				<s:if test="%{pageModel.currentPage != 1}">
					<input class="firstPage" type="button" value="首页"/>
					<input class="firstPage" type="button" value="首页"
						onclick="location.href='showTravel?pageModel.currentPage=1'" />
					<input class="frontPage"  type="button" value="上一页"
						onclick="location.href='showTravel?pageModel.currentPage=${pageModel.currentPage - 1}'" />
				</s:if>
				<s:else>
					<input class="firstPage" type="button" value="首页" disabled />
					<input class="frontPage" type="button" value="上一页" disabled />
				</s:else>
				<s:if test="pageModel.currentPage != pageModel.totalPages">
					<input class="secondPage" type="button" value="下一页"
						onclick="location.href='showTravel?pageModel.currentPage=${pageModel.currentPage + 1}'" />
					<input class="lastPage" type="button" value="尾页"
						onclick="location.href='showTravel?pageModel.currentPage=${pageModel.totalPages}'" />
				</s:if>
				<s:else>
					<input class="secondPage" type="button" value="下一页" disabled />
					<input class="lastPage" type="button" value="尾页" disabled />
				</s:else>
				</td>
			</tr>
		</tbody>
	</table>
	</form>

	</body>
</html>
